Option Strict Off
Option Explicit On
Module Module13
    Private Declare Function ECF_VerificaImpressoraLigada Lib "CONVECF.DLL" () As Integer
    Private Declare Function ECF_FlagsFiscais Lib "CONVECF.DLL" (ByRef FlagFiscal As Integer) As Integer
    Private Declare Function ECF_VerificaEstadoImpressoraMFD Lib "CONVECF.DLL" (ByRef Ack As Integer, ByRef St1 As Integer, ByRef St2 As Integer, ByRef St3 As Integer) As Integer
    Private Declare Function ECF_RetornoImpressoraMFD Lib "CONVECF.DLL" (ByRef Ack As Integer, ByRef St1 As Integer, ByRef St2 As Integer, ByRef St3 As Integer) As Integer
    Private Declare Function ECF_StatusEstendidoMFD Lib "CONVECF.DLL" (ByRef iStatus As Integer) As Integer

    Function ImpressoraLigada() As Object
        Dim retorno As Object


        retorno = ECF_VerificaImpressoraLigada()


        MsgBox(" 'Verifica Impressora Ligada' " & vbCrLf & "Status: " & retorno)

        If retorno = 1 Then
            Form1.List1.Items.Add("Impressora Ligada: Impressora Ligada")
        Else
            Form1.List1.Items.Add("Impressora Ligada: Problema na Comunicação")
        End If
    End Function

    Function FlagsFiscais() As Object
        Dim retorno As Object
        Dim Flag As Integer


        retorno = ECF_FlagsFiscais(Flag)


        MsgBox(" 'Flags Fiscais' " & vbCrLf & "Status: " & retorno)
        Form1.List1.Items.Add("Flag Fiscal: " & Flag)
    End Function

    Function EstadoImpressora() As Object
        Dim retorno As Object
        Dim iSt1, iAck, iSt2 As Object
        Dim iSt3 As Integer

        'UPGRADE_WARNING: Couldn't resolve default property of object iSt2. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object iSt1. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object iAck. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'

        retorno = ECF_VerificaEstadoImpressoraMFD(iAck, iSt1, iSt2, iSt3)


        MsgBox(" 'Verifica Estado da Impressora' " & vbCrLf & "Status: " & retorno)
        'UPGRADE_WARNING: Couldn't resolve default property of object iSt2. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object iSt1. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object iAck. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        Form1.List1.Items.Add("Estado Impressora: " & iAck & ", " & iSt1 & ", " & iSt2 & ", " & iSt3)
    End Function

    Function RetornoImpressora() As Object
        Dim retorno As Object
        Dim iSt1, iAck, iSt2 As Object
        Dim iSt3 As Integer

        'UPGRADE_WARNING: Couldn't resolve default property of object iSt2. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object iSt1. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object iAck. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'

        retorno = ECF_RetornoImpressoraMFD(iAck, iSt1, iSt2, iSt3)


        MsgBox(" 'Retorno da Impressora' " & vbCrLf & "Status: " & retorno)
        'UPGRADE_WARNING: Couldn't resolve default property of object iSt2. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object iSt1. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        'UPGRADE_WARNING: Couldn't resolve default property of object iAck. Click for more: 'ms-help://MS.VSExpressCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        Form1.List1.Items.Add("RetornoImpressora: " & iAck & ", " & iSt1 & ", " & iSt2 & ", " & iSt3)
    End Function

    Function StatusEstendido() As Object
        Dim retorno As Object
        Dim iStatus As Integer


        retorno = ECF_StatusEstendidoMFD(iStatus)


        MsgBox(" 'Status Estendido' " & vbCrLf & "Status: " & retorno)
        Form1.List1.Items.Add("StatusEstendido: " & iStatus)
    End Function
End Module